<!DOCTYPE html>
<html>
    <head>        
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Trang Chủ</title>
        <link href="<?php echo base_url('public_source/css_source/pay.css')?>" rel="stylesheet" type="text/css" />
        <link href="<?php echo base_url('public_source/css_source/right_contend.css')?>" rel="stylesheet" type="text/css"/>
        <style>
            .error {
                    border-color: #df8f8f;
                    color: #665252;
                    background-color: #ffcece;
                    color: red;
                    margin: 20px 10px 10px 10px
                }
        </style>
        <script src="<?php echo base_url('public_source/javascript/jquery-1.9.1.js');?>" type="text/javascript"></script>
        <script>
            $(document).ready(function(){
                $.ajax({
                        type: "POST",
                        url: "<?php echo site_url('user/check_login');?>",
                        data: "check=1",
                        async: false,
                        success: function(kq){
                            var getData = $.parseJSON(kq);

                                if (getData.error === "OK")
                                {
                                    $("#acc").slideDown(500);
                                    $("#no_acc").hide(500);
                                    $('[name="name4"]').val(getData.name);
                                    $('[name="email4"]').val(getData.email);
                                    $('[id="2"]').click();
                                }
                        }
                    });
                    return false;
            });
            $(document).ready(function(){
                $('[id="1"]').change(function(){
                    $("#no_acc").slideDown(500);
                    $("#acc").hide(500);
                    return false;
                });
            });
            
            $(document).ready(function() {
                $('[id="2"]').change(function(){
                    $.ajax({
                        type: "POST",
                        url: "<?php echo site_url('user/check_login');?>",
                        data: "check=1",
                        async: false,
                        success: function(kq){
                            var getData = $.parseJSON(kq);

                                if (getData.error === "OK")
                                {
                                    $("#acc").slideDown(500);
                                    $("#no_acc").hide(500);
                                    $('[name="name4"]').val(getData.name);
                                    $('[name="email4"]').val(getData.email);
                                }
                                else
                                {
                                    var loginBox = "#login-box";
                                    $(loginBox).fadeIn(300);
                                    var popMargTop = ($(loginBox).height() + 24) / 2; 
                                    var popMargLeft = ($(loginBox).width() + 24) / 2; 

                                    $(loginBox).css({ 
                                        'margin-top' : -popMargTop,
                                        'margin-left' : -popMargLeft
                                    });

                                    // Add the mask to body
                                    $('body').append('<div id="mask"></div>');
                                    $('#mask').fadeIn(500);
                                }
                        }
                    });
                    return false;
                });
                
                $(document).on('click','#mask', function() 
                { 
                  $('#mask , .login-popup').fadeOut(300 , function() 
                  {
                    $('#mask').remove();  
                    $('[id="1"]').click();

                  }); 
                return false;
                });
            });
        </script>
    </head>
    <body>
            <div ID="Support">
                <div ID="Support_Image">
                    <img src="<?php echo base_url("public_source/images_source/title_product.png");?>">
                    <div ID="Support_Title" style="margin-top: -35px">
                        Thông tin khách hàng
                    </div>
                </div>
                <div id="Info_Customer">
                    <div class="error">
                        <?php
                            echo validation_errors('<li>','</li>');
                            if(isset($error) && $error!="" && !empty($error))
                                echo $error;
                        ?>
                    </div>
                    <form id="Form_Customer" action="<?php echo site_url("home/my_cart/3") ?>" method="post">
                        <input id="1" value="3" style="margin-top: 10px; margin-left: -248px" name="1" type="radio" checked="checked"><label>Đặt mua hàng không cần tài khoản tại HitechStore.com</label>
                        <table id="no_acc" style="margin-top: 10px" cellspacing="20px">
                            <tr>
                                <td>
                                    Họ và tên <strong>*</strong>
                                </td>
                                <td colspan="2">
                                    <input name="name3" type="text" maxlength="50" style="width: 220px" >
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Email <strong>*</strong>
                                </td>
                                <td>
                                    <input name="email3" type="text" maxlength="50" style="width: 220px" >
                                </td>
                            <tr>
                                <td>
                                    Điện thoại <strong>*</strong>
                                </td>
                                <td>
                                    <input name="phone3" type="text" maxlength="50" style="width: 150px" >
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Số nhà/ Tên đường <strong>*</strong>
                                </td>
                                <td>
                                    <textarea name="address3" style="width: 320px"></textarea>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Tỉnh thành <strong>*</strong>
                                </td>
                                <td>
                                    <select name="city3" style="width: 150px">
                                        <option>TP HCM</option>
                                        <option>Nha Trang</option>
                                        <option>Hà Nội</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Quận huyện <strong>*</strong>
                                </td>
                                <td>
                                    <select name="dictrict3" style="width: 150px">
                                        <option>abc</option>
                                        <option>def</option>
                                        <option>123</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Ghi chú <strong>*</strong>
                                </td>
                                <td>
                                    <textarea name="note3" style="width: 320px; height: 100px"></textarea>
                                </td>
                            </tr>
                        </table>
                        <input id="2" name="1" value="4" value="#login-box" style="margin-top: 10px; margin-left: -248px" type="radio"><label>Đặt mua với tài khoản đăng nhập tại HitechStore.com</label>
                        <table id="acc" style="margin-top: 10px" cellspacing="20px">
                            <tr>
                                <td>
                                    Họ và tên <strong>*</strong>
                                </td>
                                <td colspan="2">
                                    <input name="name4" type="text" maxlength="50" style="width: 220px" >
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Email <strong>*</strong>
                                </td>
                                <td>
                                    <input name="email4" type="text" maxlength="50" style="width: 220px" >
                                </td>
                            <tr>
                                <td>
                                    Điện thoại <strong>*</strong>
                                </td>
                                <td>
                                    <input name="phone4" type="text" maxlength="50" style="width: 150px" >
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Số nhà/ Tên đường <strong>*</strong>
                                </td>
                                <td>
                                    <textarea name="address4" style="width: 320px"></textarea>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Tỉnh thành <strong>*</strong>
                                </td>
                                <td>
                                    <select name="city4" style="width: 150px">
                                        <option>TP HCM</option>
                                        <option>Nha Trang</option>
                                        <option>Hà Nội</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Quận huyện <strong>*</strong>
                                </td>
                                <td>
                                    <select name="dictrict4" style="width: 150px">
                                        <option>abc</option>
                                        <option>def</option>
                                        <option>123</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Ghi chú <strong>*</strong>
                                </td>
                                <td>
                                    <textarea name="note4" style="width: 320px; height: 100px"></textarea>
                                </td>
                            </tr>
                        </table>
                        <input style="width: 562px; margin-top: 10px; padding: 10px 10px 10px 10px; font-weight: bold" type="submit" value="THANH TOÁN">
                </form>
            </div>
            <?php $this->load->view("cart/pay_login") ?>
        </div>
    </body>
</html>